<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%-- 
	菜单信息分页列表展示页面 @azzcsimp
	注意relId的用法，与menu_main.jsp中的tab内容div的id属性相对应
 --%>
<div class="pageHeader" style="border:1px #B8D0D6 solid;">
	<form id="pagerForm" 
		onsubmit="return divSearch(this, '${relId}');" 
		action="menuAuth_list.action" 
		method="post">
		<input type="hidden" name="pageNum" value="${currentPage }" />
		<input type="hidden" name="numPerPage" value="${numPerPage}" />
		<input type="hidden" name="orderField" value="${param.orderField}" />
		<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
		<input type="hidden" name="parentId" value="${parentId }" >
		<input type="hidden" name="relId" value="${relId }" >
		<input type="hidden" name="sysNameDc" value="${sysNameDc }" >
		<div class="searchBar">
			<table class="searchContent" >
				<tr>
					<td style="width: 25%;">
						菜单名称：<input type="text" name="menuName" value="${menuName }" />
					</td>
					<td style="width: 70%;">
						<div style="float: left;line-height: 21px;">
						菜单类型：
						</div>
						<div style="float: left;">
						<select name="menuType"  class="combox">
							<option value="-1" >---全部---</option>
							<option ${menuType==1 ? "selected": "" } value="1" >---主菜单---</option>
							<option ${menuType==0 ? "selected": "" } value="0" >---超链接---</option>
						</select>
						</div>
					</td>
					<td style="width: 5%;" >
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</form>
</div>
<div class="pageContent" style="border-left:1px #B8D0D6 solid;border-right:1px #B8D0D6 solid">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="menuAuth_addUI.action?parentId=${parentId}&sysNameDc=${sysNameDc}" rel="menuAuth_addUI"   target="dialog" mask="true" title="新增菜单" height="400" width="740" resizable="false"  ><span>新增</span></a></li>
			<li class="line">line</li>
			<li><a class="edit" href="menuAuth_editUI.action?menuId={menu_id}&sysNameDc=${sysNameDc}" rel="menuAuth_editUI"  target="dialog" mask="true" height="400" width="740" resizable="false"   warn="请选择一个菜单" title="修改菜单"><span>修改</span>	</a></li>
			<li class="line">line</li>
			<li><a class="delete" href="menuAuth_delete.action?menuId={menu_id}&sysNameDc=${sysNameDc}"  target="ajaxTodo" callback="menuDelAjaxDone"   title="确实要删除该菜单吗?"><span>删除</span></a></li>
			<li class="line">line</li>
			<li><a class="look" href="menuAuth_show.action?menuId={menu_id}" rel="menuAuth_show"  target="dialog" mask="true" height="400" width="740" resizable="false"  warn="请选择一个菜单" title="查看菜单"><span>查看</span>	</a></li>
			<li class="line">line</li>
			<li><a id="menu_setFlagLink_${sysNameDc }" class="icon" href="menuAuth_updateFlag.action?menuId={menu_id}" target="ajaxTodo" title="确实要停用/启用该菜单吗?"><span id="menu_setFlagText_${sysNameDc }">停用/启用</span></a></li>
			<!-- 
			<li class="line">line</li>
			<li><a class="icon" href="demo/common/dwz-team.xls" target="dwzExport" targetType="navTab" title="实要导出这些记录吗?"><span>导出</span></a></li>
			 -->
		</ul>
		<div style="text-align: right;line-height: 23px;color: green;margin-right: 25px;">
			*&nbsp;&nbsp;
			<c:if test="${empty parentId}">当前信息为(${sysNameDc})系统下所有菜单列表</c:if>
			<c:if test="${!empty parentId}">当前信息为选中菜单下所有子级菜单列表</c:if>
		</div>
	</div>
	
	<table class="table" width="100%" layoutH="155" rel="${relId }">
		<thead>
			<tr>
				<th align="center">序号</th>
				<th>菜单名称</th>
				<th>菜单URL</th>
				<th>target属性</th>
				<th>rel属性</th>
				<th>上级菜单</th>
				<th>菜单类型</th>
				<th>状态</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${recordList}" var="menu" varStatus="status">
			<tr target="menu_id" rel="${menu.menuId }" onclick="doSelect(this)">
				<td>
					${(status.index+1) + (currentPage-1) * numPerPage}
					<input id="menu_flag_${sysNameDc }_${status.index}" type="hidden" value="${menu.menuStatusFlag }">
				</td>
				<td>${menu.menuName}</td>
				<td>${menu.menuUrl}</td>
				<td>${menu.menuTarget}</td>
				<td>${menu.menuRel}</td>
				<td>${menu.parent.menuName}</td>
				<td>${menu.menuType==1?"主菜单":"超链接" }</td>
				<td>
					<a style="color:${menu.menuStatusFlag==1?"green":"red"};text-decoration:none ;" >
						${menu.menuStatusFlag==1?"正常":"停用" }
					</a>
				</td>
			</tr>
			</c:forEach>
			<c:if test="${empty recordList}">
			<tr target="menu_id" rel="${menu.menuId }">
				<td colspan="8" align="center" style="text-align: center;color: red;">
					*&nbsp;&nbsp;您点选的菜单下未找到子级菜单信息！
				</td>
			</tr>
			</c:if>
		</tbody>
	</table>
	
	<div class="panelBar">
		<div class="pages">
			<span>页次&nbsp;${currentPage }&nbsp;/&nbsp;${pageCount }&nbsp;页，</span>
			<select class="combox" 
					name="numPerPage" 
					onchange="navTabPageBreak({numPerPage:this.value}, '${relId }')">
			<option ${numPerPage==20?"selected":"" } value="20">20</option>
			<option ${numPerPage==50?"selected":"" } value="50">50</option>
			<option ${numPerPage==100?"selected":"" } value="100">100</option>
		</select>
			<span>&nbsp;条，共${recordCount}条</span>
		</div>
		
		<div class="pagination" 
			rel="${relId }" 
			totalCount="${recordCount}"
			numPerPage="${pageSize}" 
			pageNumShown="${pageNumShown}"
			currentPage="${currentPage }">
		</div>

	</div>
	<style>
	<!--
	.panelBar .pages .select a{width:20px;}
	-->
	</style>
</div>